/*
 * main.c
 *
 *  Created on: 2011 2011-9-6 上午11:48:50
 *      Author: jfhu
 */
#include <stdio.h>
#include <stdlib.h>
#include "searchtree.h"

int main(void) {
	int array[10] = {50,30,60,10,40,20,15,90,70,100};

	searchtree s = makesearchtree(array, 10);

	pNode n = (pNode)malloc(sizeof(node));
	pNode t;
	initializenode1(n, 80);

	printf("Test makesearchtree and insert function\n");
	printfSearchTree(s);

	printf("Test insert function \n");
	insert(n, s);
	printfSearchTree(s);

	printf("Test access function \n");
	t = access(10, s);
	printfNode(t);

	printf("Test delete function \n");
	delete(t, s);
	printfSearchTree(s);



	return EXIT_SUCCESS;
}

